<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/static/img/logo/favicon.ico" />
    <link rel="stylesheet" href="/static/assets/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/css/footer.css">
    <link rel="stylesheet" href="/static/css/header.css">
    <title>论坛</title>
    <style>
        .avatar2 {
            width: 94px;
            height: 94px;
        }
    </style>
</head>

<body>
    {% include 'header.html' %}
    {% load friendshiptags %}
    <div class="container-fluid bg-dark">

        <div class="container" style="height: 1100px;">

            <div class="container " style="height: 100px;"></div>
            <!-- 个人信息展示 -->
            <div class="row rounded-3 shadow bg-white">
                <div class="shadow avatar avatar2 position-absolute  translate-middle p-0">
                    <img class="avatar avatar2 img-thumbnail" src="{{ user.avatar.url }}" alt="{{ user.username}}"> 
                    {% comment %} <p class="fs-6 position-absolute top-50 start-50 translate-middle">{{ user.username }}</p> {% endcomment %}
                </div>
                <div class="ms-5">
                    <p><span class="fs-1 fw-bold">{{ user.username }}</span>&#12288;ID: {{ user.id }} </p>
                    <div class="">
                        <div class="float-start me-3 mb-2 ">学院: <span class="fs-5 fw-bold">{{ user.faculty }}</span>
                        </div>
                        <div class="float-start me-3 mb-2">专业: <span class="fs-5 fw-bold">{{ user.major }}</span>
                        </div>
                        <div class="float-start me-3 mb-2">性别: <span class="fs-5 fw-bold">{{ user.sex }}</span></div>
                        <div class="float-start me-3 mb-2">年龄: <span class="fs-5 fw-bold">{{ user.age }}</span></div>
                        <div class="float-start me-3 mb-2 text-nowrap"
                            style="width: 500px; overflow: hidden; text-overflow: ellipsis;">个人简介: <span
                                class="fs-5 fw-bold">{{ user.profile }}</span></div>
                        <button id="edit-user-info"
                            class=" translate-middle float-end me-5 btn btn-sm btn-outline-secondary"
                            type="button">编辑信息</button>
                    </div>
                </div>
            </div>

            <div class="row mt-3 ">
                <!-- 功能模块展示 -->
                <div class="col-sm-6 col-md-3 bg-white shadow rounded-3 p-0" style="height: 630px;">
                    <p id="my_blog" class="nav-content  text-center fs-3 fw-normal m-2 rounded-3 bg-secondary text-light">我的博客</p>
                    <p id="my_friends" class="nav-content  text-center fs-3 fw-normal m-2 rounded-3">我的好友</p>
                    <p id="my_request" class="nav-content  text-center fs-3 fw-normal m-2 rounded-3">好友申请</p>
                    <p id="add_friend" class="nav-content  text-center fs-3 fw-normal m-2 rounded-3">添加好友</p>
                </div>

                <!-- 内容展示 -->
                <div class="col-6 col-md-9 pe-0">
                    <div id="content" class="content-right container bg-white shadow rounded-3" style="height: 630px;">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>帖子名称</th>
                                <th>帖子简介</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for topic in topics %}
                                <tr>
                                    <td>{{ topic.id }}</td>
                                    <td>{{ topic.title }}</td>
                                    <td>{{ topic.introduce }}</td>
                                    <td>
                                        <button style="float: right;" class="btn" iddd="{{ topic.id }}"
                                                onclick="deletet(this);">删除
                                        </button>
                                        <a href="/single/{{ topic.id }}">
                                            <button style="float: right;" class="btn">
                                                查看
                                            </button>
                                        </a>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>

                    </div>
                </div>

            </div>

        </div>
    </div>


    {% include 'footer.html' %}
    <script src="/static/assets/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="/static/assets/plugins/jquery/jquery.min.js"></script>
    <!-- jquery处理ajax -->
    <script src="/static/js/user-info.js"></script>
</body>

</html>

